package com.cnplan.service;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.cnplan.core.Result;
import com.cnplan.entity.SystemRole;
import com.cnplan.entity.SystemUser;

import java.util.List;

/**
 * Created by Administrator on 2018/4/25.
 */
public interface AuthService {

    // 系统用户相关操作
    SystemUser getSystemUser(SystemUser user);
    SystemUser getSystemUserByUsername(String username);

    List<SystemUser> listSystemUser(Wrapper<SystemUser> ew);

    List<SystemUser> listSystemUser(Wrapper<SystemUser> ew, String keyword);

    Result insertSystemUser(SystemUser user);

    Result updateSystemUser(SystemUser user);

    Result deleteSystemUser(Long id);

    Result modifyPassword(Integer type, Long id, String oriPassword, String newPassword);

    Result resetUserRoles(Long userId, Long... roleIds);

    // 角色操作
    SystemRole getSystemRole(SystemRole systemRole);

    List<SystemRole> listSystemRole(Wrapper<SystemRole> ew);

    List<SystemRole> listSystemRole(Wrapper<SystemRole> ew, String keyword);

    Result insertSystemRole(SystemRole systemRole);

    Result updateSystemRole(SystemRole systemRole);

    Result deleteSystemRole(Long id);

    List<SystemRole> listRoleByUserId(Long userId);

}
